The present invention pertains to a method and apparatus to improve efficiency in multiple-pass frame encoding. More particularly, the present invention pertains to a method and apparatus which reduces the number of processing steps that are taken to encode a frame in a multiple-pass, bit-rate-controlled frame encoding environment.
Video encoding is a known procedure in the art for converting video image data into a digital bitstream that can then be transferred to a transmission medium or a storage medium (e.g., a compact disc read only memory (CD-ROM)). For example, a camera can be provided that generates video image data for a video capture component. The video capture component “captures” the video image data from the camera one frame at a time in a known manner and at a predetermined rate (e.g., approximately 30 frames per second). The video capture component transfers the video frame data to a video compressor which may compress the video image data for the frame under the control of a bit rate controller. The video compressor typically includes a coder/decoder (codec) that compresses the video image data according to a compression algorithm (the compression step is often referred to as encoding). For codecs that are used in the transfer of video data over a transmission medium (e.g., telephone lines, the Internet, etc.), typical compression algorithms include any of a variety of block transform based algorithms such as H.261 (International Telecommunication Union—Telecommunications Standardization Sector (ITU-T), March, 1993), H.263 (ITU-T, Dec. 5, 1995), MPEG-I, and MPEG-II (International Organization for Standardization/International Electrotechnical Commission (ISO/IEC) 11172-2 and 13818-2).
In a rudimentary example of video compression, the video frame of data that is captured by the video capture component is encoded in a single pass. In other words, the compression algorithm is executed with one iteration to form a compressed bit stream. A problem that is seen with this type of compression is that the amount of data in the bit stream may exceed (or substantially undershoot) the allowable bandwidth for that information. For example, in a video telephone application transmission of 30 frames per second video over standard phone lines using a single pass compression algorithm may produce too much data to be handled by the phone lines. Also, if the compressed video stream is being stored to a storage medium (e.g., to a compact disc), single pass compression may produce a bit stream that exceeds the capacity of the storage medium. Alternatively, if the amount of data substantially undershoots the available bandwidth for that information, the quality of the video data is unnecessarily reduced.
One known procedure for controlling the size of the bit stream or more accurately, the bit rate (i.e., size of the bit stream per unit time) is to employ a bit rate controller. Almost all video compression algorithms include a quantization parameter that has an inverse proportional effect on the bit rate (i.e., an increase in the quantization parameter results in a lower bit rate and vice versa). Given a target bit rate, a bit rate controller causes the video compressor to perform several iterations (passes) of the compression algorithm with different quantization parameters to achieve the target bit rate. For example, the video compressor may perform an initial pass, where the compression algorithm is executed in its entirety with an initial quantization parameter. Based on the result, a second (or retrial) pass is performed where the compression algorithm is executed in its entirety with a new quantization parameter. Several retrial passes can be performed, modifying the quantization parameter each time, until the target bit rate is achieved (within a given tolerance). The video compressor will then perform a final pass with the final quantization parameter.
A problem that is seen with the multiple-pass compression using a bit rate controller is that it takes some time to perform all of the steps in each pass. Each pass includes a number of complex computational steps and sub-steps that take time to execute. In a videophone application, there may be insufficient time to perform a sufficient number of retrial passes to obtain the target bit rate. Also, when storing the compressed bit stream to a storage medium, it may take an excessive amount of time to perform as many retrial passes as needed to achieve the target bit rate.
In view of the above, there is a need for a method and apparatus that improves the efficiency of a multiple-pass video encoding operation.